package com.ityu.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ityu.mapper.LogMapper;
import com.ityu.pojo.result.PageResult;
import com.ityu.pojo.vo.OperateLogVo;
import com.ityu.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    LogMapper logMapper;

    @Override
    public PageResult<OperateLogVo> page(Integer page, Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        Page<OperateLogVo> result = (Page<OperateLogVo>) logMapper.page();
        return new PageResult<OperateLogVo>(result.getTotal(),result.getResult());
    }
}
